function PatchTestT3Damage
clc
%close all
addpath('..');
addpath('../..');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% mesh
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
nodes = [ 0 0;
    1 0;
    1 1;
    0 1 ];
connectivities = [ 1 2 3;
    1 3 4];
mesh = createMesh(nodes,connectivities);
%mesh.printMyself();
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% conditions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
lambda = [linspace(0,1,81) linspace(1,0,11) linspace(0,2,41)];
% lambda = [linspace(0,1,11)];
du = 1;
constraint = [  1 0 0 0.0 0.0;
    2 0 0 du 0.0;
    3 0 1 du 0.0;
    4 0 1 0.0 0.0   ];
setConstraints(mesh,constraint);
plotMesh(mesh);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% element declaration; custom section
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
M = fem2.Model(mesh);
nf = mesh.countFaces();
E = 2;
nu = 0.3;
ft = 0.91;
e0 = ft/E;
ef = 3*e0;
DamageLaw = 'exponential';
% EquivalentStrainMode = 'euclidean';
EquivalentStrainMode = 'strain norm';
C = C_plane_stress(E,nu);
for i=1:nf
    e = fem2.matlab.T3MatlabElement(mesh.getFace(i-1));
    M.addElement(e);
    %create struct to contain element state variables
    es = createElementContainer();
    es.constitutiveMatrix = C;
    es.elasticConstitutiveMatrix = C;
    es.e0 = e0;
    es.ef = ef;
    es.kappa = e0;
    es.kappa_old = e0;
    es.kappa_old_old = e0;
    es.DamageLaw = DamageLaw;
    es.EquivalentStrainMode = EquivalentStrainMode;
    elements(i) = es;
end

postProcessInfo.infoList = {'resistant force'};
postProcessInfo.infoParam = {[1 4]};

[elements,output] = solving_strategy_static_2(elements,M,...
    lambda,50,1e-6,postProcessInfo);

figure
res_node_1(:,:) = -output.resistant_force(:,1,:);
delta = lambda*du;
plot(delta,res_node_1);

rmpath('..');
rmpath('../..');
end
